

'use strict';

const express=require('express');
const path=require('path');

// 创建路由对象

const adminRouter=express.Router();
// 引入控制器文件
const adminCtrl=require(path.join(__dirname,"../controllers/adminController.js"));

adminRouter.get('/admin_add',adminCtrl.adminAdd);

// 数据提交控制器
adminRouter.post('/admin_add',adminCtrl.adminAddData);

adminRouter.get('/admin_list',adminCtrl.adminLdit);

// 去编辑页面的显示旧信息

adminRouter.get('/admin_edit/:admin_id',adminCtrl.adminEdit);
adminRouter.post('/admin_edit/:admin_id',adminCtrl.adminEditAdd);


// 删除管理员

adminRouter.get('/admin_delete/:admin_id',adminCtrl.adminDelete);



module.exports=adminRouter;





